package com.springboot.nucleic.controller;

import com.springboot.nucleic.po.Report;
import com.springboot.nucleic.response.ResponseData;
import com.springboot.nucleic.response.SuccessResponseData;
import com.springboot.nucleic.service.ReportService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("report")
@AllArgsConstructor
public class ReportController {

    private final ReportService reportService;


    @GetMapping("findReportById")
    public Report findReportById(String id){

        return reportService.selectReportById(id);
    }

    @PostMapping("updateReport")
    public ResponseData updateReport(@RequestBody Report report){
        reportService.updateReport(report);
        return new SuccessResponseData();
    }
}
